export interface AllData {
    code: number
    message: string
    ok: number
}

export interface SpuValue {
    category3Id: SorN
    createTime?: string
    description: string
    id?: SorN
    spuImageList: null | ImgData[]
    spuName?: string
    spuPosterList?: null | []
    spuSaleAttrList: null | SpuAttr[]
    tmId?: SorN
    updateTime?: string
}

export interface SpuData {
    countId?: null
    current?: number
    hitCount?: boolean
    maxLimit?: null
    id?: number
    optimizeCountSql?: boolean
    orders?: []
    pages: number
    records: SpuValue[]
    size: number
    total: number
}

export interface ReturnSUP extends AllData {
    data: SpuData
}

export type SorN = string | number

export interface PpData {
    id: SorN
    createTime: string
    updateTime: string
    tmName: string
    logoUrl: string
}

export interface ReturnPpList extends AllData {
    data: PpData[]
}

export interface ImgData {
    id?: number
    imgName?: string
    imgUrl?: string
    createTime?: string
    updateTime?: string
    spuId?: number
    name?: string
    url?: string
}

export interface ReturnImages extends AllData {
    data: ImgData[]
}
export interface SkuData {
    id?: SorN
    createTime?: null
    updateTime?: null
    spuId?: number
    baseSaleAttrId: SorN
    saleAttrValueName: string
    saleAttrName?: string
    isChecked?: null
    show?: boolean
    attrName?: string
}

export interface SpuAttr {
    id?: SorN
    createTime?: null
    updateTime?: null
    spuId?: SorN
    baseSaleAttrId: SorN
    saleAttrName: string
    spuSaleAttrValueList: SkuData[]
    show?: boolean
    attrName?: string
}

export interface ReturnAttr extends AllData {
    data: SpuAttr[]
}

export interface Attr {
    id: SorN
    createTime: string
    updateTime: string
    name: string
    valueName?: string
}

export interface ReturnAllAttr extends AllData {
    data: Attr[]
}

export interface Attr {
    attrId: SorN //平台属性的ID
    valueId: SorN //属性值的ID
}

export interface saleArr {
    id?: number
    saleAttrId: SorN //属性ID
    saleAttrValueId: SorN //属性值的ID
    saleAttrValueName?: string
}
export interface SkuAdd {
    category3Id: SorN //三级分类的ID
    spuId: SorN //已有的SPU的ID
    tmId: SorN //SPU品牌的ID
    id?: number
    skuName: string //sku名字
    price: SorN //sku价格
    weight: SorN //sku重量
    skuDesc: string //sku的描述
    skuAttrValueList?: Attr[]
    skuSaleAttrValueList?: saleArr[]
    skuImageList?: [
        {
            imgUrl: string
            id: number
        },
    ]
    skuDefaultImg: string //sku图片地址
}
